<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo ($title); ?></title>
<link href="/MMbook/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="/MMbook/Public/bootstrap/css/bootstrap-theme.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/MMbook/Public/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/MMbook/Public/bootstrap/js/bootstrap.min.js"></script>
</head>

<body>
<nav class="navbar navbar-default">
  <div class="container-fluid container"> 
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">小说系统</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
      <a class="navbar-brand" href="#">小说系统</a> </div>
    
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">系统管理 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">系统设置</a></li>
            <li><a href="#">栏目管理</a></li>
            <li class="divider"></li>
            <li><a href="#">管理员列表</a></li>
          </ul>
        </li>
        <li class="dropdown"> <a href="#" class="dropdown-toggle active" data-toggle="dropdown" role="button" aria-expanded="false">书籍管理 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="/MMbook/index.php/Admin/BookType/index">书籍类型</a></li>
            <li><a href="/MMbook/index.php/Admin/Book/book_list">书籍列表</a></li>
            <li class="divider"></li>
            <li><a href="#">书籍文章</a></li>
          </ul>
        </li>
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">文章管理 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">系统设置</a></li>
            <li><a href="#">栏目管理</a></li>
            <li class="divider"></li>
            <li><a href="#">管理员列表</a></li>
          </ul>
        </li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <form class="navbar-form navbar-left" action="/MMbook/index.php/Admin/Book/index" method="post" role="search">
          <div class="form-group">
            <input type="text" name="book_name" class="form-control" placeholder="小说名称">
          </div>
          <button type="submit" class="btn btn-default">搜索</button>
        </form>
        <li><a href="#">报表</a></li>
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">用户名 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">修改资料</a></li>
            <li><a href="#">查看日志</a></li>
            <li><a href="#">查看留言</a></li>
            <li class="divider"></li>
            <li><a href="#">退出</a></li>
          </ul>
        </li>
      </ul>
    </div>
    <!-- /.navbar-collapse --> 
  </div>
  <!-- /.container-fluid --> 
</nav>
<div class="container">

<div class="panel panel-default"> 
  <!-- Default panel contents -->
  <div class="panel-heading">书籍列表 <a class="btn btn-primary btn-xs"  href="/MMbook/index.php/Admin/Book/add_book" style="display:block; float:right;"><i class="glyphicon glyphicon-plus"></i>添加新书</a> <form action="/MMbook/index.php/Admin/Book/book_list" style=" float:right;" method="post"><button style="float:right;margin-right: 20px;" type="submit" class="btn btn-default btn-xs">搜索</button><span style="float:right;">
    <select class="form-control input-sm" name="type_name" style="width:100px;height: 22px;padding-top: 0px; padding-bottom: 0px;">
      <option value="">全部</option>
      <?php if(is_array($type_list)): foreach($type_list as $key=>$type): ?><option value="<?php echo ($type["order"]); ?>"><?php echo ($type["type_name"]); ?></option><?php endforeach; endif; ?>
    </select>
    </span></form> </div>
  <table class="table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th width="100px">#</th>
        <th>缩略图</th>
        <th>书籍名称</th>
        <th width="120">作者</th>
        <th width="80">类型</th>
        <th width="60">状态</th>
        <th width="150">日期</th>
        <th width="135">操作</th>
      </tr>
    </thead>
    <tbody>
      <?php if(is_array($book_list)): foreach($book_list as $key=>$book): ?><tr>
          <th scope="row"><a href="/MMbook/index.php/Admin/LookBook/index/?id=<?php echo ($book["_id"]); ?>"><?php echo ($book["_id"]); ?></a></th>
          <td><a href="/MMbook/index.php/Admin/LookBook/index/?id=<?php echo ($book["_id"]); ?>"><img src="<?php echo ($book["thumbnail"]); ?>" width="60px" height="80px"/></a></td>
          <td><a href="/MMbook/index.php/Admin/LookBook/index/?id=<?php echo ($book["_id"]); ?>"><?php echo ($book["book_name"]); ?></a></td>
          <td><?php echo ($book["author"]); ?></td>
          <td><?php echo ($book["type_name"]); ?></td>
          <td><?php if($book["status"] == '1'): ?>已发布
              <?php else: ?>
              未发布<?php endif; ?></td>
          <td><?php echo ($book["datetime"]); ?></td>
          <td ><a class="btn btn-info btn-xs" href="/MMbook/index.php/Admin/LookBook/index/?id=<?php echo ($book["_id"]); ?>"><i class="glyphicon glyphicon-search"></i>看</a> <a class="btn btn-primary btn-xs" href="/MMbook/index.php/Admin/Book/edit_book/?id=<?php echo ($book["_id"]); ?>"><i class="glyphicon glyphicon-pencil"></i>改</a> <a class="btn btn-danger  btn-xs" href="javascript:if(confirm('删除吗？'))window.location.href='/MMbook/index.php/Admin/Book/del_book/?id=<?php echo ($book["_id"]); ?>';"><i class="glyphicon glyphicon-trash"></i>删</a> 
            <!--<a class="btn btn-info btn-xs" href="/MMbook/index.php/Admin/Book/edit_book/?id=<?php echo ($book["_id"]); ?>">查看</a>
          		<a class="btn btn-primary btn-xs" href="/MMbook/index.php/Admin/Book/edit_book/?id=<?php echo ($book["_id"]); ?>">修改</a>
                <a class="btn btn-danger  btn-xs" href="/MMbook/index.php/Admin/Book/del_book/?id=<?php echo ($book["_id"]); ?>">删除</a>-->
          </td>
        </tr><?php endforeach; endif; ?>
    </tbody>
  </table>
</div>
<link href="/MMbook/Public/static/css/page.css" rel="stylesheet" type="text/css" />
<div class="scott"><?php echo ($page); ?></div>


</div>
</body>
</html>